<?xml version='1.0' encoding='UTF-8' ?>
<!--

    Copyright (c) 2014, 2019 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <h:outputStylesheet library="css" name="default.css" />
        <title>
            #{bundle.OrderDetail_Title}
        </title>
    </h:head>

    <h:body>
        <h:form styleClass="jsfcrud_list_form">
            <h:panelGroup rendered="#{orderDetailController.items.rowCount > 0}">

                <h2><h:outputText value="Items for order ##{param['orderId']}"/></h2>
                <h:dataTable value="#{orderDetailController.items}" var="item" border="0" cellpadding="2" cellspacing="0" width="100%" rowClasses="firstRow, secondRow" rules="all" style="border:solid 1px">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListOrderDetailTitle_qty}"/>
                        </f:facet>
                        <h:outputText value="#{item.qty}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListOrderDetailTitle_product}"/>
                        </f:facet>
                        <h:outputText value="#{item.product.name}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListProductTitle_price}"/>
                        </f:facet>
                        <h:outputText value="#{item.product.price}">
                            <f:convertNumber currencySymbol="$" type="currency"/>
                        </h:outputText>
                    </h:column>
                </h:dataTable>
            </h:panelGroup>
            <br />
            <h:commandLink onclick="window.close()" value="#{bundle.OrderDetail_CloseButton}" style="color:white; font-weight: bold;" />
        </h:form>
    </h:body>

</html>
